package com.itheima.interpreter;

/**
 * @author zzw
 * @date 2025/10/26
 * @description 解释器模式（终结符表达式类）
 */
public class Value extends AbstractExpression {
    private final int value;

    public Value(int value) {
        this.value = value;
    }

    @Override
    public int interpret(Context context) {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }
}
